# -*- coding: utf-8 -*-


def remove_item_if_feature_empty(X, Y):
    assert len(X) == len(Y)

    _X = []
    _Y = []

    for (x,y) in zip(X,Y):
        if len(x) == 0:
            continue
        _X.append(x)
        _Y.append(y)
    return _X,_Y

def remove_item_by_label(X,Y, filter=[]):
    _X = []
    _Y = []

    for x,y in zip(X,Y):
        if y not in filter:
            _X.append(x)
            _Y.append(y)
    return _X,_Y

if __name__ == '__main__':

    X = [
        ['1','1'],
        [],
        ['3']
    ]

    Y = [
        ['a'],
        ['b'],
        ['c']
    ]

    X,Y = remove_item_if_feature_empty(X,Y)

    print(X)
    #[['1', '1'], ['3']]
    print(Y)
    #[['a'], ['c']]
    pass